package net.ikenway.springboot.demo.Model.Dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.ikenway.springboot.demo.Model.Entity.Product;
import org.springframework.format.annotation.NumberFormat;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author MasterKenway <zk@ikenway.net>
 * @Description
 * @date Created Date 12/20/2020
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ActivityDto implements Serializable {
    private Long actId;

    @NotNull(message = "活动名称不能为空")
    @NotEmpty(message = "活动名称不能为空")
    private String actName;

    @NotNull(message = "活动预览图不能为空")
    @NotEmpty(message = "活动预览图不能为空")
    private String imageUrl;

//    @NotNull(message = "活动页面不能为空")
//    @NotEmpty(message = "活动页面不能为空")
//    private String pageUrl;

    @NotNull(message = "活动折扣不能为空")
    @DecimalMax(value = "1", message = "活动折扣不能大于1")
    @DecimalMin(value = "0", message = "活动折扣不能大于0")
    private BigDecimal disCount;


    @NotNull(message = "活动产品不能为空")
    @NotEmpty(message = "活动产品不能为空")
    private List<Long> productIds;

    private List<Product> products;

    @NumberFormat
    private Integer displayOrder;

    private Boolean enable;
}
